import request from '@/utils/request';

//发布动态内容
export const contentCreate = (params: any) => {
    return request({
        url: '/app-api/member/content/create',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//更新动态内容(包含发布及编辑内容)
export const contentUpdate = (params: any) => {
    return request({
        url: '/app-api/member/content/update',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//获取当前用户的关注分页
export const followPage = (params: any) => {
    return request({
        url: '/app-api/member/content/follow/page',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//获取当前用户的关注分页
export const fenPage = (params: any) => {
    return request({
        url: '/app-api/member/user/fans-list',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//获得宠物圈动态分页
export const contentPage = (params: any) => {
    return request({
        url: '/app-api/member/content/page',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//获取草稿箱
export const draftPage = (params: any) => {
    return request({
        url: '/app-api/member/content/draft/page',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};

//获得我的宠物圈动态分页
export const myPage = (params: any) => {
    return request({
        url: '/app-api/member/content/my/page',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//获取草稿箱
export const draftDel = (params: any) => {
    return request({
        url: '/app-api/member/content/delete',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//动态内容点赞
export const likeIncrese = (params: any) => {
    return request({
        url: '/app-api/member/content/like/increse',
        method: 'PUT',
        body: params,
        hideLoading: true,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
};
//取消内容点赞
export const likeDecrese = (params: any) => {
    return request({
        url: '/app-api/member/content/like/decrese',
        method: 'PUT',
        body: params,
        hideLoading: true,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
};
//动态内容关注
export const followIncrese = (params: any) => {
    return request({
        url: '/app-api/member/content/follow/increse',
        method: 'PUT',
        body: params,
        hideLoading: true,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
};
//取消内容关注
export const followDecrese = (params: any) => {
    return request({
        url: '/app-api/member/content/follow/decrese',
        method: 'PUT',
        body: params,
        hideLoading: true,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
};
//获取宠物圈动态详情
export const contentDetail = (params: any) => {
    return request({
        url: '/app-api/member/content/detail',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//创建宠物圈动态内容评价
export const commentCreate = (params: any) => {
    return request({
        url: '/app-api/member/comment/create',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//回复宠物圈动态内容评价
export const commentCreateReply = (params: any) => {
    return request({
        url: '/app-api/member/comment/createReply',
        method: 'POST',
        body: params,
        hideLoading: false,
    });
};
//获取指定内容的全部评价
export const commentGet = (params: any) => {
    return request({
        url: '/app-api/member/comment/get',
        method: 'GET',
        body: params,
        hideLoading: false,
    });
};
//关注用户
export const contentFollow = (params: any) => {
    return request({
        url: '/app-api/member/content/follow',
        method: 'PUT',
        body: params,
        hideLoading: false,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
};
//取消关注
export const contentUnfollow = (params: any) => {
    return request({
        url: '/app-api/member/content/unfollow',
        method: 'DELETE',
        body: params,
        hideLoading: false,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
    });
};

//点赞
export const commentLike = (data: any) => {
    return request({
        url: '/app-api/member/comment/like/'+data.commentId,
        method: 'POST',
        body: data,
        hideLoading: false,

    });
};
//取消点赞
export const commentUnLike = (params: any) => {
    return request({
        url: `/app-api/member/comment/unlike/${params}`,
        method: 'POST',
        hideLoading: false,

    });
};

//推荐信息
export const recommendedpage = (params: any) => {
    return request({
        url: '/app-api/member/content/recommended/page',
        method: 'POST',
        body: params,
        hideLoading: false,

    });
};
